package cc.rengu.redp.bizimpl.upmp.service;

import cc.rengu.redp.bizimpl.upmp.domain.UpmpSysParam;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author System
 */
public interface IUpmpSysParamService extends IService<UpmpSysParam> {

    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
    UpmpSysParam getById(String id);

    List<UpmpSysParam> findChildrenByPrimaryKey(String primaryKey, String instId, String parentId);


    UpmpSysParam findDefaultInst(String primaryKey, String instId,String parentId);

    /**
     * 根据父节点PrimaryKey和当前节点primaryKey，获取当前节点记录信息
     * @param primaryKey 当前节点primaryKey
     * @param parentPrimaryKey 父节点PrimaryKey
     * @return
     */
//   UpmpSysParam findChildrenByPrimaryKey(String primaryKey,String parentPrimaryKey, String instId);

    /**
     * 根据顶级节点PrimaryKey获取顶级点记录信息
     * @param parentPrimaryKey 顶级点PrimaryKey
     * @return
     */
    public UpmpSysParam findByPrimaryKey(String parentPrimaryKey, String instId,String parentId);

    Map<String, String> findMapDataByPrimaryKey(String primaryKey, String instId,String parentId);
    Map<String, UpmpSysParam> findMapObjectByPrimaryKey(String primaryKey, String instId,String parentId);
    /**
     * 根据父节点PrimaryKey和当前节点primaryKey，获取当前节点记录信息
     *
     * @param primaryKey       当前节点primaryKey
     * @param parentPrimaryKey 父节点PrimaryKey
     * @param instId           法人行
     * @param parentParentId   父节点parentId
     * @return
     */
    UpmpSysParam findChildrenByPrimaryKeyAndParent(String primaryKey, String parentPrimaryKey, String instId,String parentParentId);

}
